<!DOCTYPE html>
<html lang="en" xmlns:th="https://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title th:text="${ title }"></title>
</head>
<body>
    <form action="/role/addOrModify" method="post">
        <label for="name">名字<input id="name" name="name" type="text" th:value="${role.name}"></label><br>
        <label for="alias">别名<input id="alias" name="alias" type="text" th:value="${role.alias}"></label><br>
        <label>权限:</label>
            <input type="checkbox" th:each=" permission: ${permissions}" th:value="${permission.id}"
                   th:text="${permission.name}" th:checked="${hasPermissions.contains(permission)}" name="permissions"><br>
        <input type="hidden" name="id" th:value="${role.id}">
        <input type="submit" th:value="${role.id != null ? '修改': '新增'}">
    </form>
</body>
</html>